import multiprocessing
import time


def set_num1(name, age):
    while True:
        print(f"1-----{name},{age}------------")
        time.sleep(1)


def set_num2(name, age):
    while True:
        print(f"2-----{name},{age}------------")
        time.sleep(1)


if __name__ == "__main__":
    # 创建进程
    p1 = multiprocessing.Process(target=set_num1, args=('zhangsan', 18))
    p2 = multiprocessing.Process(target=set_num2, args=('lisi', 20))
    p1.start()
    p2.start()
